package main

import (
	"fmt"
	"os"

	"pwsh-go/internal/shell"
)

const (
	Version = "1.0.0"
	AppName = "PowerShell Go CLI with AI Integration"
)

func main() {
	// Handle command line arguments
	if len(os.Args) > 1 {
		switch os.Args[1] {
		case "--version", "-v":
			fmt.Printf("%s v%s\n", AppName, Version)
			return
		case "--help", "-h":
			printHelp()
			return
		}
	}

	if err := shell.Run(); err != nil {
		fmt.Fprintf(os.Stderr, "Error: %v\n", err)
		os.Exit(1)
	}
}

func printHelp() {
	fmt.Printf("%s v%s\n\n", AppName, Version)
	fmt.Println("Usage: pwsh-go [options]")
	fmt.Println("\nOptions:")
	fmt.Println("  --version, -v    Show version information")
	fmt.Println("  --help, -h       Show this help message")
	fmt.Println("\nWithout options, starts the interactive PowerShell Go CLI.")
}
